package com.guqj.pattern.facade.client;

import com.guqj.pattern.facade.modal.CPU;
import com.guqj.pattern.facade.modal.Disk;
import com.guqj.pattern.facade.modal.Screen;

/**
 * <p>
 * 	外观模式是为了解决类与类之间的依赖关系的,降低了类类之间的耦合度
 * </p>
 * @author guqj
 * @date   2017年3月14日
 */
public class Computer {

	private CPU cpu;
	private Disk disk;
	private Screen screen;

	public Computer() {
		this.cpu = new CPU();
		this.disk = new Disk();
	}

	public void start() {
		System.out.println("begin start Computer ");
		cpu.start();
		disk.start();
		screen.start();
		System.out.println("start computer finished!");
	}

	public void shutdown() {
		System.out.println("begin shutdown Computer ");
		cpu.shutdown();
		disk.shutdown();
		screen.shutdown();
		System.out.println("computer shutdown!");
	}
}
